#include "tile.h"

using namespace GoldenAges;

void CTile::Think(const int &iElapsedTime)
{
    CEntity::Think(iElapsedTime);
}

void CTile::Render(SDL_Surface *pDestSurf)
{
    CEntity::Render(pDestSurf);
}

bool CTile::LoadData(TiXmlElement* pXMLData)
{
    CEntity::LoadData(pXMLData);

    int iTileX = atoi(pXMLData->Attribute("x")),
        iTileY = atoi(pXMLData->Attribute("y"));

	SetTilePos(iTileX, iTileY);

	return true;
}

TiXmlElement CTile::SaveData(void)
{
    TiXmlElement Tile("tile");
	Tile.SetAttribute("x", GetTilePosX());
	Tile.SetAttribute("y", GetTilePosY());

	Tile.InsertEndChild(CEntity::SaveData());

	return Tile;
}
